<template>
	<list-box :name="name" :word="word" :params="params">

		<view class="mfzx row" v-for="(item, index) in courseData" v-if="index<2" :key="index"
		@click="navTo(`/pages/doctor/info?id=${item.id}`)">
			<view>
				<image class="mfzx-img " :src="item.img"></image>
			</view>

			<view class="tech-z">
				<view class="space-between tech-name-info">
					<view class="tech-name">{{item.name}}</view>
					<view class="mxfx-wz center">
						咨询
					</view>
				</view>
				<view class="tech-info">{{item.introduce}}</view>
			</view>
		</view>

		

	</list-box>
</template>

<script>
	import listBox from './list-box.vue'
	import courseItem from '@/components/common/course-item.vue'
	import courseData from '@/mock/courseData.js'
	export default {
		components: {
			listBox,
			courseItem
		},
		props: {
			name: {
				type: String,
				default: '热门推荐'
			},
			word: { // HOT
				type: String,
				default: null
			},
			column: { // 默认swiper-item展示2列
				type: Number,
				default: 2
			},
			rows: { // 默认4行
				type: Number,
				default: 5
			},
			courseData: {
				type: Array,
				default: () => courseData
			},

			params: Object, // 点击`全部`按钮要向搜索页传递的查询条件
		}
	}
</script>

<style lang="scss">
	// .list-swiper {
	// 	height: 800rpx;
	// }
	.mfzx {
		align-items: center;

		margin-top: 50rpx;
		width: 690rpx;
		height: 180rpx;
		background: #FFFFFF;
		box-shadow: 0px 2rpx 31rpx 1rpx rgba(227, 225, 229, 0.4);
		border-radius: 20rpx;

		.mfzx-img {
			height: 120rpx;
			width: 120rpx;
			margin-left: 30rpx;
			border-radius: 50%;

		}

		.tech-z {
			// background-color: #005CC5;
			height: 120rpx;
			width: 481rpx;
			margin-left: 30rpx;
		}

		.tech-name-info {

			// height: 120rpx;
			// width: 481rpx;
			// background-color: #005CC5;
			.tech-name {
				width: 98rpx;
				height: 33rpx;
				font-size: 32rpx;
				font-family: Microsoft YaHei;
				font-weight: bold;
				color: #333333;
			}

			.mxfx-wz {
				width: 130rpx;
				height: 46rpx;
				background: linear-gradient(90deg, #BB73D5, #643A92);
				border-radius: 23rpx;
				font-size: 24rpx;

				font-family: Microsoft YaHei;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 36rpx;

			}

		}

		.tech-info {
			margin-top: 18rpx;
			max-width: 480rpx;
			height: 70rpx;
			font-size: 22rpx;
			font-family: Microsoft YaHei;
			font-weight: 400;
			color: #999999;
			line-height: 35rpx;
			// 显示两行，超出部分用...代替
			overflow: hidden; // 超出隐藏
			text-overflow: ellipsis; //超出部分显示省略号
			-webkit-line-clamp: 2; //设置显示的行数
			display: -webkit-box; // 将对象作为弹性伸缩盒子模型显示
			-webkit-box-orient: vertical; // 设置或检索伸缩盒对象的子元素的排列方式 纵向
			white-space: normal; // 空白会被浏览器忽略


		}
	}
</style>
